
public class Rectangle {
	private double width;
	private double length;
	
	public double getWidth() {
		return width;
	}

	public void setWidth(double width) {
		if (width >= 0) {
			this.width = width;
		}
	}

	public double getLength() {
		return length;
	}

	public void setLength(double length) {
		if (length > 0) {
			this.length = length;
		}
	}

	public Rectangle() {
		width = 0;
		length = 0;
	}
	
	public Rectangle(double width, double length) {
		if (width >= 0) {
			this.width = width;
		}
		if (length > 0) {
			this.length = length;
		}
	}
	
	public double zhouChang() {
		return 2 * (width + length);
	}
	
	public double mianJi() {
		return width * length;
	}
}
